<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>测量报告及系统消息查询</title>
<%
	// 权限验证
	if(session.getAttribute("currentMemberShip")==null){
		response.sendRedirect("login.jsp");
		return;
	}
%>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
	var page=0;
	var lasttime;
	
	function getCommonData() {
		var district = $("#district").combotree("getText");
		var startTime=$("#i1").datebox("getValue");
		var endTime=$("#i2").datebox("getValue");
		var IMSI = '';
		var MSISDN = '';
		var CTCS_ID = '';
		
		if ($('#in1').searchbox('getName') == 'IMSI') {
			IMSI = $('#in1').searchbox('getValue');
		} else if ($('#in1').searchbox('getName') == 'MSISDN') {
			MSISDN = $('#in1').searchbox('getValue');
		} else if ($('#in1').searchbox('getName') == 'CTCS_ID') {
			CTCS_ID = $('#in1').searchbox('getValue');
		}
		var UmType = $("#UmType").combotree("getText");
		
		
		var kilometerStart = $("#kilometerStart").val();
		var kilometerStart2 = $("#kilometerStart2").val();
		
		if (kilometerStart2.length == 2) {
			kilometerStart2 = '0' + kilometerStart2;
		} else if (kilometerStart2.length == 1) {
			kilometerStart2 = '00' + kilometerStart2;
		} else if (kilometerStart2.length == 0 && kilometerStart.length > 0) {
			kilometerStart2 = '000' + kilometerStart2;
		}
		var kilometerStartLong = kilometerStart + kilometerStart2;

		var kilometerEnd = $("#kilometerEnd").val();
		var kilometerEnd2 = $("#kilometerEnd2").val();
		if (kilometerEnd2.length == 2) {
			kilometerEnd2 = '0' + kilometerEnd2;
		} else if (kilometerEnd2.length == 1) {
			kilometerEnd2 = '00' + kilometerEnd2;
		} else if (kilometerEnd2.length == 0 && kilometerEnd.lenght > 0) {
			kilometerEnd2 = '000' + kilometerEnd2;
		}
		var kilometerEndLong = kilometerEnd +kilometerEnd2;
		

		var recordId = $("#recordId").val()
		
		startDate = new Date(startTime.replace(new RegExp("-","gm"),"/"));
		endDate = new Date(endTime.replace(new RegExp("-","gm"),"/"));
		var startTimeLong = startDate.getTime();
		var endTimeLong = endDate.getTime();
		return {"startTime":startTimeLong, "endTime":endTimeLong, "IMSI":IMSI, "MSISDN":MSISDN, "CTCS_ID":CTCS_ID, "recordId": recordId,
		 	"UmType":UmType, "district":district, "kilometerStart":kilometerStartLong, "kilometerEnd":kilometerEndLong};
	}
	
	function searchSACCH(){
		page=1;
		
		var data = getCommonData();
		
		if(data.startTime -data.endTime > 0){
			$.messager.alert("系统提示","查询开始时间不能大于结束时间！");
			return;
		} 
		if(data.kilometerStart - data.kilometerEnd > 0){
			$.messager.alert("系统提示","公里标下限值不能大于公里标上限值！");
			return;
		}
		
		sendData(data, page, '1');
	}
	
	function searchNext(){
		var size=$("#dg" ).datagrid("getPager" ).data("pagination" ).options.pageSize;
		var rows  = $('#dg').datagrid("getRows");  
		if(rows.length<size){
			$.messager.alert("系统提示","当前页已经是最后一页！");
			return;
		} else {
			lasttime=rows[rows.length-1].timeStamp;
		}

		var data = getCommonData();
		
		data.startTime = lasttime;
		page=page+1;
		
		sendData(data, page, '1');
	}
	function searchBack(){
		if(page==1){
			$.messager.alert("系统提示","当前页已经是第一页！");
			 return;
		}

		var data = getCommonData();
		
		var rowsbefore  = $('#dg').datagrid("getRows"); 
		if(rowsbefore.length>0){
			data.endTime = rowsbefore[0].timeStamp;
		} else {
			data.endTime = lasttime+1;
		}
		page=page-1;
		
		sendData(data, page, '0');
	}
	
	function sendData(data, page, increase) {
		var currentpage="第 "+page+" 页";
		var p=$("#dg" ).datagrid("getPager" )
		$(p).pagination({ //设置分页页数
			displayMsg:currentpage
		});
		
		$("#dg").datagrid('load',{
		 	"startTime":data.startTime,
			"endTime":data.endTime,
			"IMSI":data.IMSI,
			"MSISDN":data.MSISDN,
			"CTCS_ID":data.CTCS_ID,
			"UmType":data.UmType,
			"district":data.district,
			"kilometerStart":data.kilometerStart,
			"kilometerEnd":data.kilometerEnd,
			"search":'1',
			"recordId": data.recordId,
			"increase":increase
		});
	}
	
	function openSACCHAddDialog(){
		 $("#dlg").dialog("open").dialog("setTitle","添加SACCH信息");
		 $("#flag").val(1);
		 $("#primaryKey").attr("readonly",false);
	}
	
	function openSACCHModifyDialog(){
		 var selectedRows=$("#dg").datagrid("getSelections");
		 if(selectedRows.length!=1){
			 $.messager.alert("系统提示","请选择一条要编辑的数据！");
			 return;
		 }
		 var row=selectedRows[0];
		 $("#dlg").dialog("open").dialog("setTitle","编辑SACCH信息");
		 $("#fm").form("load",row);
		 $("#flag").val(2);
		 $("#id").attr("readonly",true);
	}
	
	function save(){
		$("#fm").form("submit",{
			url:"${pageContext.request.contextPath}/sacch/save.do",
			onSubmit:function(){
				return $(this).form("validate");
			},
			success:function(result){
				var result=eval('('+result+')');
				if(result.success){
					$.messager.alert("系统提示","保存成功！");
					resetValue();
					$("#dlg").dialog("close");
					$("#dg").datagrid("reload");
				}else{
					$.messager.alert("系统提示","保存失败！");
					return;
				}
			}
		 });
	}
	
	function checkData(){
		var flag=$("#flag").val();
		if(flag==1){
			$.post("${pageContext.request.contextPath}/sacch/exisPrimaryKey.do",{primaryKey:$("#primaryKey").val()},function(result){
				if(result.exist){
					 $.messager.alert("系统提示","该PrimaryKey已存在，请更换下！");
					 $("#primaryKey").focus();
				}else{
					save();
				}
			},"json");
		}else{
			save();
		}
	}
	
	function resetValue(){
		 $("#primaryKey").val("");
		 $("#timeStamp").val("");
		 $("#startTime").val("");
		 $("#frontProcessorId").val("");
		 $("#recordId").val("");
		 $("#IMSI").val("");
		 $("#logicChannel").val("");
		 $("#MSISDN").val("");
		 $("#direction").val("");
		 $("#frameNumber").val("");
		 $("#siteName").val("");
		 $("#decode").val("");
		 $("#rawMessage").val("");
		 $("#BCCH").val("");
		 $("#NO_NCELL_M").val("");
		 $("#BCCH_FREQ_NCELL").val("");
		 $("#kilometer").val("");
		 $("#speed").val("");
		 $("#CI").val("");
		 $("#LAC").val("");
		 $("#CTCS_ID").val("");
		 $("#ENGINE_ID").val("");
		 $("#MS_TYPE").val("");
		 $("#message_TYPE").val("");
		 $("#sourceData").val("");
		 $("#NCellLev1").val("");
		 $("#NCellLev2").val("");
		 $("#NCellLev3").val("");
		 $("#NCellLev4").val("");
		 $("#NCellLev5").val("");
		 $("#NCellLev6").val("");
		 $("#NCellLev7").val("");
		 $("#NCellLev8").val("");
		 $("#powerLevel").val("");
		 $("#RX_LEV_Full").val("");
		 $("#RX_LEV_Sub").val("");
		 $("#RX_QUAL_Full").val("");
		 $("#RX_QUAL_Sub").val("");
		 $("#TA").val("");
		 $("#TS").val("");
		 $("#ARFCNs").val("");
		 $("#NCBCCH_BISC1").val("");
		 $("#NCBCCH_BISC2").val("");
		 $("#NCBCCH_BISC3").val("");
		 $("#NCBCCH_BISC4").val("");
		 $("#NCBCCH_BISC5").val("");
		 $("#NCBCCH_BISC6").val("");
		 $("#NCBCCH_BISC7").val("");
		 $("#NCBCCH_BISC8").val("");
		 $("#frame").val("");
		 $("#timeSlot").val("");
		 $("#TMSI").val("");
		 $("#channel").val("");
		 $("#TCH").val("");
		 $("#IMEI").val("");
		 $("#l2").val("");
		 $("#DECODED").val("");
		 $("#dataLength").val("");
		 $("#LRBG").val("");
		 $("#CRC_ECC").val("");
		 $("#t_Train").val("");
		 $("#FP_999").val("");
		 $("#FP_1000").val("");
		 $("#FP_1001").val("");
		 $("#FP_1002").val("");
		 $("#FP_1003").val("");
		 $("#FP_1004").val("");
		 $("#FP_1005").val("");
		 $("#FP_1006").val("");
		 $("#FP_1007").val("");
		 $("#FP_1008").val("");
		 $("#FP_1009").val("");
		 $("#FP_1010").val("");
		 $("#FP_1011").val("");
		 $("#FP_1012").val("");
		 $("#FP_1013").val("");
		 $("#FP_1014").val("");
		 $("#FP_1015").val("");
		 $("#FP_1016").val("");
		 $("#FP_1017").val("");
		 $("#FP_1018").val("");
	}
	
	function closeDialog(){
		 $("#dlg").dialog("close");
		 resetValue();
	}
	
	function deleteSACCH(){
		 var selectedRows=$("#dg").datagrid("getSelections");
		 if(selectedRows.length==0){
			 $.messager.alert("系统提示","请选择要删除的数据！");
			 return;
		 }
		 var strIds=[];
		 for(var i=0;i<selectedRows.length;i++){
			 strIds.push(selectedRows[i].primaryKey);
		 }
		 var ids=strIds.join(",");
		 $.messager.confirm("系统提示","您确定要删除这<font color=red>"+selectedRows.length+"</font>条数据吗？",function(r){
			if(r){
				$.post("${pageContext.request.contextPath}/sacch/delete.do",{primaryKeys:ids},function(result){
					if(result.success){
						 $.messager.alert("系统提示","数据已成功删除！");
						 $("#dg").datagrid("reload");
					}else{
						$.messager.alert("系统提示","数据删除失败，请联系系统管理员！");
					}
				},"json");
			} 
		 });
	}
	function postExcelFile(params, url) { //params是post请求需要的参数，url是请求url地址
	    var form = document.createElement("form");
	    form.style.display = 'none';
	    form.action = url;
	    form.method = "post";
	    document.body.appendChild(form);

	    for(var key in params){
	      var input = document.createElement("input");
	      input.type = "hidden";
	      input.name = key;
	      input.value = params[key];
	      form.appendChild(input);
	    }
		
	    form.submit();
	    form.remove();
	  }
	
	function exportSACCHInCurrentPage(){
		var rows  = $('#dg').datagrid("getRows");  
		if (rows.length < 1) {
			$.messager.alert("系统提示", "请查询需要导出的数据");
			return;
		}
    	var params = {data:JSON.stringify(rows)};
    	console.log(rows);
    	postExcelFile(params, "${pageContext.request.contextPath}/sacch/exportcurrentpage.do");
	}
	
	function exportByTemplateInCurrentPage(){
		var rows = $("#dg").datagrid("getRows");
		var strIds=[];
		 for(var i=0;i<rows.length;i++){
			 strIds.push(rows[i].primaryKey);
		 }
		 var ids=strIds.join(",");
		 window.open('${pageContext.request.contextPath}/sacch/exportByTemplate.do?ids='+ids+'');
	}
	
	function exportSACCHInAllPages(){
		var data = getCommonData();
		window.open('${pageContext.request.contextPath}/sacch/export.do?startTime='+data.startTime+'&endTime='+data.endTime+'&IMSI='+data.IMSI+'&MSISDN='+data.MSISDN+'&CTCS_ID='+data.CTCS_ID+'&UmType='+data.UmType+'&district='+data.district+'&kilometerStart='+data.kilometerStart+'&kilometerEnd='+data.kilometerEnd+'&recordId='+data.recordId);
	}
	
	function exportSDCCHInAllPages(){
		var data = getCommonData();
		window.open('${pageContext.request.contextPath}/sdcch_facch/export.do?startTime='+data.startTime+'&endTime='+data.endTime+'&IMSI='+data.IMSI+'&MSISDN='+data.MSISDN+'&CTCS_ID='+data.CTCS_ID+'&district='+data.district+'&kilometerStart='+data.kilometerStart+'&kilometerEnd='+data.kilometerEnd+'&recordId='+data.recordId);
	}
	function exportTCHInAllPages(){
		var data = getCommonData();
		window.open('${pageContext.request.contextPath}/tch/export.do?startTime='+data.startTime+'&endTime='+data.endTime+'&IMSI='+data.IMSI+'&MSISDN='+data.MSISDN+'&recordId='+data.recordId+
				'&CTCS_ID='+data.CTCS_ID+'&district='+data.district+'&kilometerStart='+data.kilometerStart+'&kilometerEnd='+data.kilometerEnd);
	}
	function exportByTemplateInAllPages(){
		 window.open('${pageContext.request.contextPath}/sacch/exportByTemplate.do?ids='+null+'');
	}
	
	function openUploadFileDialog(){
		$("#dlg2").dialog('open').dialog('setTitle','批量导入数据');
	}
	
	function downloadTemplate(){
		window.open('template/sacchExportTemplate.xls');
	}
	
	function uploadFile(){
		$("#uploadForm").form("submit",{
			success:function(result){
				var result=eval('('+result+')');
				if(result.errorMsg){
					$.messager.alert("系统提示",result.errorMsg);
				}else{
					$.messager.alert("系统提示","上传成功");
					$("#dlg2").dialog("close");
					$("#dg").datagrid("reload");
				}
			}
		});
	}
	
	function formatDatebox(value) {
		 	var datetimeType = "";
		    var date =new Date(parseInt(value));
		    datetimeType = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()
		    +" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()+" "+date.getMilliseconds();
		    return datetimeType;
	}
	
	function formatRawMessage(value) {
		return JSON.stringify(value);
	}
	
	function formatDirection(value) {
		if(value==0){
			return "下行";
		}else{
			return "上行";
		}
	}
	
	function formatLogicChannel(value) {
		if(value==0){
			return "FrequencySpectrum";
		}else if(value==1){
			return "SDCCH";
		}else if(value==2){
			return "SACCH";
		}else if(value==3){
			return "TCH";
		}else if(value==4){
			return "SACCH_WITH_TCH";
		}else if(value==5){
			return "FACCH";
		}else if(value==7){
            return "BCCH";
        }
        else if(value==8){
            return "AGCH";
        }
		else return value;
	}
	//重写分页
	$(function(){
		var p = $('#dg').datagrid('getPager');
	    $(p).pagination({ //设置分页功能栏
	           //分页功能可以通过Pagination的事件调用后台分页功能来实现
	            //layout:['prev','next'],
                layout:['list','sep'],
                /* beforePageText: '第',//页数文本框前显示的汉字 
                afterPageText: '页', */
	            displayMsg:"",   
	            buttons:[{
	    			iconCls:'icon-undo',
	    			handler:function(){
	    				searchSACCH();
	    			}
	    		},{
	    			iconCls:'icon-back',
	    			handler:function(){
	    				searchBack();
	    			}
	    		}, {
	    			iconCls:'icon-next',
	    			handler:function(){
	    				searchNext();
	    			}
	    		}]
	    });
	    
	    $('#UmType').combotree('loadData', [{id:'1000', text:'全选', children:[
	    	{id:'0', text:'Measurement Report'},
		    {id:'1', text:'S RNR'},
		    {id:'2', text:'System Information Type 5'},
		    {id:'3', text:'System Information Type 6'},
		    {id:'4', text:'U UI'}]}]);
	    
	    $('#district').combotree({
	    	url: '${pageContext.request.contextPath}/sdcch/sdcchDistrictComboList.do'
	    });
	    
	    $('#i1').datetimebox('setValue', formatterDate(new Date(new Date(new Date().toLocaleDateString()).getTime())));
		$('#i2').datetimebox('setValue', formatterDate(new Date()));
		$('.searchbox-button').remove()
	});
	
	
	formatterDate = function (date) {
		var day = date.getDate();
		var month = (date.getMonth() + 1);
		var hor = date.getHours();
		var min = date.getMinutes();
		var sec = date.getSeconds();
		return date.getFullYear() + '-' + month + '-' + day+' '+hor+':'+min+':'+sec;
	};

	function formatKilometer(value) {
//		if (value.length <= 0) return; 
//		var start = value.substring(0, 4);
//		var end = value.substring(4, 7);
//		return 'k' + start + '+' + end;
		if(value.length > 3) {
			var start = value.substring(0,value.length-3);
			var end = value.substring(value.length-3, value.length);
			return 'k' + start + '+' + end;
		}
		else return value;
	}
	
	function formatMSISDN(value) {
		return value == "255" ? "" : value;
	}
	
	

	
	
</script>
</head>
<body style="margin: 1px">
	
<table id="dg" title="测量报告及系统消息查询" class="easyui-datagrid"
   fitColumns="fasle" pagination="true" rownumbers="true" pageSize="100" pageList="[100,200,300,400,500]"
   url="${pageContext.request.contextPath}/sacch/list.do" fit="true" toolbar="#tb">
   <thead>
   	<tr>
   		<th field="cb" checkbox="true" align="center"></th>
   		<th field="timeStamp" width="140" align="center" formatter="formatDatebox">触发时间</th>
   		<th field="IMSI" width="110" align="center">IMSI</th>
		<%--<th field="IMSI" width="140" align="center" formatter="formatDatebox">开始时间</th>--%>
   		<!-- <th field="logicChannel" width="80" align="center" formatter="formatLogicChannel">LogicChannel</th> -->
   		<th field="MSISDN" width="90" align="center" formatter="formatMSISDN">MSISDN</th>
   		<th field="CTCS_ID" width="80" align="center">机车号</th>
   		<th field="siteName" width="80" align="center">小区名称</th>
   		<th field="BCCH" width="80" align="center">BCCH</th>
   		<th field="TCH" width="80" align="center">TCH</th>
   		<th field="timeSlot" width="60" align="center">时隙号</th>
   		<th field="direction" width="80" align="center" formatter="formatDirection">方向</th>
   		<th field="frameNumber" width="80" align="center">帧号</th>
   		<th field="message_TYPE" width="120" align="center">Um接口消息类型</th>
		<th field="LEVEL" width="120" align="center">LEVEL</th>
		<th field="SNR" width="120" align="center">SNR</th>
		<th field="QUALITY" width="120" align="center">QUALITY</th>
   		<th field="RX_LEV_Full" width="80" align="center">RX_LEV_Full</th>
   		<!-- <th field="RX_LEV_Sub" width="60" align="center">RX_LEV_Sub</th> -->   		
   		<th field="RX_QUAL_Full" width="80" align="center">RX_QUAL_Full</th>
   		<th field="TA" width="70" align="center">TA</th>
   		<th field="ARFCNs" width="100" align="center">ARFCNs</th>
   		<th field="FP_1000" width="70" align="center">FP_1000</th>
   		<th field="FP_1001" width="70" align="center">FP_1001</th>
   		<th field="FP_1002" width="70" align="center">FP_1002</th>
   		<th field="FP_1003" width="70" align="center">FP_1003</th>
   		<th field="FP_1004" width="70" align="center">FP_1004</th>
   		<th field="FP_1005" width="70" align="center">FP_1005</th>
   		<th field="FP_1006" width="70" align="center">FP_1006</th>
   		<th field="FP_1007" width="70" align="center">FP_1007</th>
   		<th field="FP_1008" width="70" align="center">FP_1008</th>
   		<th field="FP_1009" width="70" align="center">FP_1009</th>
   		<th field="FP_1010" width="70" align="center">FP_1010</th>
   		<th field="FP_1011" width="70" align="center">FP_1011</th>
   		<th field="FP_1012" width="70" align="center">FP_1012</th>
   		<th field="FP_1013" width="70" align="center">FP_1013</th>
   		<th field="FP_1014" width="70" align="center">FP_1014</th>
   		<th field="FP_1015" width="70" align="center">FP_1015</th>
   		<th field="FP_1016" width="70" align="center">FP_1016</th>
   		<th field="FP_1017" width="70" align="center">FP_1017</th>
   		<th field="FP_1018" width="70" align="center">FP_1018</th>
   		
   		<!-- <th field="RX_QUAL_Sub" width="60" align="center">RX_QUAL_Sub</th> -->
   		<th field="kilometer" width="80" align="center" formatter="formatKilometer">公里标</th>
   		<th field="speed" width="80" align="center">速度（km/h）</th>
   		<th field="dataLength" width="60" align="center">数据长度</th>
   		<th field="sourceData" width="120" align="center">数据源码</th>
   		<th field="decode" width="120" align="center">解码信息</th>
   		<!-- <th field="rawMessage" width="80" align="center" formatter="formatRawMessage">源信息</th> -->
   		<!-- <th field="NO_NCELL_M" width="80" align="center">NO_NCELL_M</th> -->
   		<!-- <th field="BCCH_FREQ_NCELL" width="80" align="center">BCCH_FREQ_NCELL</th> -->
   		<!-- <th field="ENGINE_ID" width="80" align="center">ENGINE_ID</th> 
   		<th field="NCellLev1" width="80" align="center">NCellLev1</th>
   		<th field="NCellLev2" width="80" align="center">NCellLev2</th>
   		<th field="NCellLev3" width="80" align="center">NCellLev3</th>
   		<th field="NCellLev4" width="80" align="center">NCellLev4</th>
   		<th field="NCellLev5" width="80" align="center">NCellLev5</th>
   		<th field="NCellLev6" width="80" align="center">NCellLev6</th>
   		<th field="NCellLev7" width="80" align="center">NCellLev7</th>
   		<th field="NCellLev8" width="80" align="center">NCellLev8</th>-->
   		<!-- <th field="powerLevel" width="80" align="center">PowerLevel</th> -->
   		<!-- <th field="TS" width="80" align="center">TS</th> -->
   		<th field="MS_TYPE" width="80" align="center">终端类型</th>
   		<th field="TMSI" width="80" align="center">TMSI</th>
   		<!--
   		<th field="NCBCCH_BISC1" width="80" align="center">NCBCCH_BISC1</th>
   		<th field="NCBCCH_BISC2" width="80" align="center">NCBCCH_BISC2</th>
   		<th field="NCBCCH_BISC3" width="80" align="center">NCBCCH_BISC3</th>
   		<th field="NCBCCH_BISC4" width="80" align="center">NCBCCH_BISC4</th>
   		<th field="NCBCCH_BISC5" width="80" align="center">NCBCCH_BISC5</th>
   		<th field="NCBCCH_BISC6" width="80" align="center">NCBCCH_BISC6</th>
   		<th field="NCBCCH_BISC7" width="80" align="center">NCBCCH_BISC7</th>
   		<th field="NCBCCH_BISC8" width="80" align="center">NCBCCH_BISC8</th>
   		 <th field="frame" width="80" align="center">Frame</th> -->
   		<!-- <th field="channel" width="80" align="center">Channel</th> -->
   		<!-- <th field="IMEI" width="80" align="center">IMEI</th> -->
   		<!-- <th field="l2" width="80" align="center">L2</th> -->
   		<!-- <th field="DECODED" width="80" align="center">DECODED</th> -->
   		<th field="CI" width="80" align="center">CI</th>
   		<th field="LAC" width="80" align="center">LAC</th>
   		<th field="frontProcessorId" width="80" align="center">前置机号</th>
   		<th field="recordId" width="80" align="center">记录号</th>
   		<!-- <th field="LRBG" width="80" align="center">LRBG</th> -->
   		<!-- <th field="CRC_ECC" width="80" align="center">CRC_ECC</th>
   		<th field="t_Train" width="80" align="center">T_Train</th> -->   		
   		<!--<th field="primaryKey" width="80" align="center">主键</th>-->
   	</tr>
   </thead>
 </table>
 <div id="tb">
 	<div style="margin:5px">
 	  <%-- <c:if test="${currentMemberShip.group.name=='管理员' }">
 		<a href="javascript:openSACCHAddDialog()" class="easyui-linkbutton" iconCls="icon-add" plain="true">添加</a>
 		<a href="javascript:openSACCHModifyDialog()" class="easyui-linkbutton" iconCls="icon-edit" plain="true">修改</a>
 		<a href="javascript:deleteSACCH()" class="easyui-linkbutton" iconCls="icon-remove" plain="true">删除</a>
 	  </c:if> --%>
 		<a href="javascript:exportSACCHInCurrentPage()" class="easyui-linkbutton" iconCls="icon-save" plain="true">导出当前页测量报告及系统消息</a>
 		<a href="javascript:exportSACCHInAllPages()" class="easyui-linkbutton" iconCls="icon-save" plain="true">导出所有页测量报告及系统消息</a>
 		<a href="javascript:exportSDCCHInAllPages()" class="easyui-linkbutton" iconCls="icon-save" plain="true">导出当前条件所有信令数据</a>
 		<a href="javascript:exportTCHInAllPages()" class="easyui-linkbutton" iconCls="icon-save" plain="true">导出当前条件所有TCH数据</a>
 		<!-- <a href="javascript:exportByTemplateInCurrentPage()" class="easyui-linkbutton" iconCls="icon-save" plain="true">用模版导出当前测量报告及系统消息</a>
 		<a href="javascript:exportByTemplateInAllPages()" class="easyui-linkbutton" iconCls="icon-save" plain="true">用模版导出所有测量报告及系统消息</a> -->
      <%-- <c:if test="${currentMemberShip.group.name=='管理员' }">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-import" plain="true" onclick="openUploadFileDialog()">用模版批量导入数据</a>
 	  </c:if> --%>
 	</div>
 	<div style="margin:5px">
 		<%-- &nbsp;小区：&nbsp;<input class="easyui-combobox" size="10" id="district" name="district" data-options="panelHeight:'130',valueField:'siteName',textField:'siteName',url:'${pageContext.request.contextPath}/sacch/sacchDistrictComboList.do'" value="请选择小区..." onkeydown="if(event.keyCode==13) searchSACCH()"/>
 		&nbsp;前置机号：&nbsp;<input class="easyui-combobox" size="15" id="frontProcessorId" name="frontProcessorId" data-options="panelHeight:'130',valueField:'frontProcessorId',textField:'frontProcessorId',url:'${pageContext.request.contextPath}/sacch/sacchFrontProcessorIdComboList.do'" value="请选择前置机号..." onkeydown="if(event.keyCode==13) searchSACCH()"/>
 		&nbsp;时间：&nbsp;<input type="text" id="i1" size="20" class="easyui-datetimebox" style="width:150px" />&nbsp;至&nbsp;
		<input type="text" id="i2" size="20" class="easyui-datetimebox"  style="width:150px" />
 		&nbsp;IMSI：&nbsp;<input class="easyui-combobox" size="15" id="IMSI" name="IMSI" data-options="panelHeight:'130',valueField:'IMSI',textField:'IMSI',url:'${pageContext.request.contextPath}/sacch/sacchIMSIComboList.do'" value="请选择IMSI..." onkeydown="if(event.keyCode==13) searchSACCH()"/>
		&nbsp;MSISDN：&nbsp;<input class="easyui-combobox" size="15" id="MSISDN" name="MSISDN" data-options="panelHeight:'130',valueField:'MSISDN',textField:'MSISDN',url:'${pageContext.request.contextPath}/sacch/sacchMSISDNComboList.do'" value="请选择MSISDN..." onkeydown="if(event.keyCode==13) searchSACCH()"/>
		&nbsp;机车号：&nbsp;<input class="easyui-combobox" size="15" id="CTCS_ID" name="CTCS_ID" data-options="panelHeight:'130',valueField:'CTCS_ID',textField:'CTCS_ID',url:'${pageContext.request.contextPath}/sacch/sacchCTCS_IDComboList.do'" value="请选择机车号..." onkeydown="if(event.keyCode==13) searchSACCH()"/>
		&nbsp;Um接口信令类型：&nbsp;<input class="easyui-combobox" size="25" id="UmType" name="UmType" data-options="panelHeight:'130',valueField:'message_TYPE',textField:'message_TYPE',url:'${pageContext.request.contextPath}/sacch/sacchMessage_TYPEComboList.do'" value="请选择Um接口信令类型..." onkeydown="if(event.keyCode==13) searchSACCH()"/>
 		 --%>
 		<!-- &nbsp;小区：&nbsp;<input type="text" size="10" id="district" name="district"  onkeydown="if(event.keyCode==13) searchSACCH()"/>
 		&nbsp;前置机号：&nbsp;<input type="text" size="15" id="frontProcessorId" name="frontProcessorId" onkeydown="if(event.keyCode==13) searchSACCH()"/>
 		 -->
 		&nbsp;&nbsp;小区：
 		<select id="district" class="easyui-combotree" data-options="panelHeight:'auto', panelMaxHeight:'240px'" style="width:176px;" multiple></select>
 		<!--<input class="easyui-combobox" style="width:calc(10%)" id="district" multiple=true name="district" data-options="panelHeight:'130',valueField:'id',textField:'name',url:'${pageContext.request.contextPath}/sacch/sacchDistrictComboList.do'" value="" onkeydown="if(event.keyCode==13) searchSACCH()"/>-->
 		
 		
 		&nbsp;&nbsp;时间：
 		<input type="text" id="i1" style="width:calc(8%)" class="easyui-datetimebox"  />&nbsp;至&nbsp;
		<input type="text" id="i2" style="width:calc(8%)" class="easyui-datetimebox" />
 		
 		
 		<!-- &nbsp;IMSI：&nbsp;
 		<input type="text" style="width:calc(5%)" id="IMSI" name="IMSI" onkeydown="if(event.keyCode==13) searchSACCH()"/>
		&nbsp;MSISDN：&nbsp;
		<input type="text" style="width:calc(5%)" id="MSISDN" name="MSISDN" onkeydown="if(event.keyCode==13) searchSACCH()"/>
		&nbsp;机车号：&nbsp;
		<input type="text" style="width:calc(5%)" id="CTCS_ID" name="CTCS_ID" onkeydown="if(event.keyCode==13) searchSACCH()"/> -->
		
		
		<!-- <input type="text" data-options="valueField:'lable',textField:'value', data:[
					    {lable:'0', value:'Measurement Report'},
					    {lable:'1', value:'S RNR'},
					    {lable:'2', value:'System Information Type 5'},
					    {lable:'3', value:'System Information Type 6'},
					    {lable:'4', value:'U UI'}]" value="" class="easyui-combobox" multiple=true style="width:calc(10%)" id="UmType" name="UmType" onkeydown="if(event.keyCode==13) searchSACCH()"/> -->
 		
 		
 		&nbsp;&nbsp;公里标：k<input type="text" id="kilometerStart" style="width:35px" onkeydown="if(event.keyCode==13) searchSACCH()"/>+<input type="text" id="kilometerStart2" style="width:35px" onkeydown="if(event.keyCode==13) searchSACCH()"/>
 		&nbsp;至&nbsp;k
		<input type="text" id="kilometerEnd" style="width:35px" onkeydown="if(event.keyCode==13) searchSACCH()"/>+<input type="text" id="kilometerEnd2" style="width:35px" onkeydown="if(event.keyCode==13) searchSACCH()"/>
 		
 		&nbsp;&nbsp;Um接口消息类型：
		<select id="UmType" class="easyui-combotree" data-options="panelHeight:'auto', panelMaxHeight:'240px'" style="width:225px;" multiple></select>&nbsp;&nbsp;
 		&nbsp;&nbsp;记录号 ：<input type="text" style="width:110px" id="recordId" name="recordId" onkeydown="if(event.keyCode==13) searchSACCH()"/>
 		
 		&nbsp;&nbsp;<input id="in1" class="easyui-searchbox" data-options="prompt:'Please Input Value',menu:'#mm'" style="width:205px; margin-top:-20px"></input>
		<div id="mm">
			<div data-options="name:'IMSI'">IMSI</div>
			<div data-options="name:'MSISDN'">MSISDN</div>
			<div data-options="name:'CTCS_ID'">机车号</div>
		</div>
 		
 		<a href="javascript:searchSACCH()" class="easyui-linkbutton" iconCls="icon-search" plain="true"><b style="font-size:15px">查询</b></a>
 	</div>
 </div>
 
 <div id="dlg" class="easyui-dialog" style="width:620px;height:250px;padding: 10px 20px"
   closed="true" buttons="#dlg-buttons">
   
   <form id="fm" method="post">
   	<table cellspacing="8px">
   		<tr>
   			<td>primaryKey：</td>
   			<td><input type="text" id="primaryKey" name="primaryKey" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>timeStamp：</td>
   			<td><input type="text" id="timeStamp" name="timeStamp" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>startTime：</td>
   			<td><input type="text" id="startTime" name="startTime" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>frontProcessorId：</td>
   			<td><input type="text" id="frontProcessorId" name="frontProcessorId" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>recordId：</td>
   			<td><input type="text" id="recordId" name="recordId" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>iMSI：</td>
   			<td><input type="text" id="iMSI" name="iMSI" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>logicChannel：</td>
   			<td><input type="text" id="logicChannel" name="logicChannel" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>mSISDN：</td>
   			<td><input type="text" id="mSISDN" name="mSISDN" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>direction：</td>
   			<td><input type="text" id="direction" name="direction" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>frameNumber：</td>
   			<td><input type="text" id="frameNumber" name="frameNumber" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>siteName：</td>
   			<td><input type="text" id="siteName" name="siteName" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>decode：</td>
   			<td><input type="text" id="decode" name="decode" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>rawMessage：</td>
   			<td><input type="text" id="rawMessage" name="rawMessage" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>bCCH：</td>
   			<td><input type="text" id="bCCH" name="bCCH" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>nO_NCELL_M：</td>
   			<td><input type="text" id="nO_NCELL_M" name="nO_NCELL_M" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>bCCH_FREQ_NCELL：</td>
   			<td><input type="text" id="bCCH_FREQ_NCELL" name="bCCH_FREQ_NCELL" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>kilometer：</td>
   			<td><input type="text" id="kilometer" name="kilometer" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>speed：</td>
   			<td><input type="text" id="speed" name="speed" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>cI：</td>
   			<td><input type="text" id="cI" name="cI" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>lAC：</td>
   			<td><input type="text" id="lAC" name="lAC" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>cTCS_ID：</td>
   			<td><input type="text" id="cTCS_ID" name="cTCS_ID" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>eNGINE_ID：</td>
   			<td><input type="text" id="eNGINE_ID" name="eNGINE_ID" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>mS_TYPE：</td>
   			<td><input type="text" id="mS_TYPE" name="mS_TYPE" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>message_TYPE：</td>
   			<td><input type="text" id="message_TYPE" name="message_TYPE" class="easyui-validatebox" required="true"/></td>
   		</tr>
		<tr>
			<td>LEVEL：</td>
			<td><input type="text" id="LEVEL" name="LEVEL" class="easyui-validatebox" required="true"/></td>
			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			<td>SNR：</td>
			<td><input type="text" id="SNR" name="SNR" class="easyui-validatebox" required="true"/></td>
		</tr>
		<tr>
			<td>QUALITY：</td>
			<td><input type="text" id="QUALITY" name="QUALITY" class="easyui-validatebox" required="true"/></td>
			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
		</tr>
   		<tr>
   			<td>sourceData：</td>
   			<td><input type="text" id="sourceData" name="sourceData" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>nCellLev1：</td>
   			<td><input type="text" id="nCellLev1" name="nCellLev1" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>nCellLev2：</td>
   			<td><input type="text" id="nCellLev2" name="nCellLev2" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>nCellLev3：</td>
   			<td><input type="text" id="nCellLev3" name="nCellLev3" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>nCellLev4：</td>
   			<td><input type="text" id="nCellLev4" name="nCellLev4" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>nCellLev5：</td>
   			<td><input type="text" id="nCellLev5" name="nCellLev5" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>nCellLev6：</td>
   			<td><input type="text" id="nCellLev6" name="nCellLev6" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>nCellLev7：</td>
   			<td><input type="text" id="nCellLev7" name="nCellLev7" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>nCellLev8：</td>
   			<td><input type="text" id="nCellLev8" name="nCellLev8" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>rX_LEV_Full：</td>
   			<td><input type="text" id="rX_LEV_Full" name="rX_LEV_Full" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>rX_LEV_Sub：</td>
   			<td><input type="text" id="rX_LEV_Sub" name="rX_LEV_Sub" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>rX_QUAL_Full：</td>
   			<td><input type="text" id="rX_QUAL_Full" name="rX_QUAL_Full" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>rX_QUAL_Sub：</td>
   			<td><input type="text" id="rX_QUAL_Sub" name="rX_QUAL_Sub" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>tA：</td>
   			<td><input type="text" id="tA" name="tA" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>tS：</td>
   			<td><input type="text" id="tS" name="tS" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>aRFCNs：</td>
   			<td><input type="text" id="aRFCNs" name="aRFCNs" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>nCBCCH_BISC1：</td>
   			<td><input type="text" id="nCBCCH_BISC1" name="nCBCCH_BISC1" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>nCBCCH_BISC2：</td>
   			<td><input type="text" id="nCBCCH_BISC2" name="nCBCCH_BISC2" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>nCBCCH_BISC3：</td>
   			<td><input type="text" id="nCBCCH_BISC3" name="nCBCCH_BISC3" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>nCBCCH_BISC4：</td>
   			<td><input type="text" id="nCBCCH_BISC4" name="nCBCCH_BISC4" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>nCBCCH_BISC5：</td>
   			<td><input type="text" id="nCBCCH_BISC5" name="nCBCCH_BISC5" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>nCBCCH_BISC6：</td>
   			<td><input type="text" id="nCBCCH_BISC6" name="nCBCCH_BISC6" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>nCBCCH_BISC7：</td>
   			<td><input type="text" id="nCBCCH_BISC7" name="nCBCCH_BISC7" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>nCBCCH_BISC8：</td>
   			<td><input type="text" id="nCBCCH_BISC8" name="nCBCCH_BISC8" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>frame：</td>
   			<td><input type="text" id="frame" name="frame" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>timeSlot：</td>
   			<td><input type="text" id="timeSlot" name="timeSlot" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>tMSI：</td>
   			<td><input type="text" id="tMSI" name="tMSI" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>channel：</td>
   			<td><input type="text" id="channel" name="channel" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>tCH：</td>
   			<td><input type="text" id="tCH" name="tCH" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>iMEI：</td>
   			<td><input type="text" id="iMEI" name="iMEI" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>l2：</td>
   			<td><input type="text" id="l2" name="l2" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>dECODED：</td>
   			<td>
   			<input type="text" id="dECODED" name="dECODED" class="easyui-validatebox" required="true"/>
   			<input type="hidden" id="flag" name="flag"/>
   			</td>
   		</tr>
   	</table>
   </form>
 </div>
 
 <div id="dlg-buttons">
 	<a href="javascript:checkData()" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
 	<a href="javascript:closeDialog()" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>
 </div>
 
 <div id="dlg2" class="easyui-dialog" style="width:400px;height:180px;padding:10px 20px"
            closed="true" buttons="#dlg-buttons2">
        <form id="uploadForm" action="${pageContext.request.contextPath}/sacch/upload.do" method="post" enctype="multipart/form-data">
        	<table>
        		<tr>
        			<td>下载模版：</td>
        			<td><a href="javascript:void(0)" class="easyui-linkbutton"  onclick="downloadTemplate()">导入模版</a></td>
        		</tr>
        		<tr>
        			<td>上传文件：</td>
        			<td><input type="file" name="sacchUploadFile"></td>
        		</tr>
        	</table>
        </form>
	</div>
    
	<div id="dlg-buttons2">
		<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="uploadFile()">上传</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg2').dialog('close')">关闭</a>
	</div>
	
	
</body>
</html>